
from translate import translate_texts
from translate import process_file

def main():
    try:
        '''
        text_arr = ['OpenAI and Microsoft are done']
        
        text_arr = ['さっきのは竹田さんがいい人だったからなんとかなったけど']
        
        trans_result = translate_texts(text_arr)

        print("翻译结果如下:")
        for i, text in enumerate(text_arr):
            print(f"{text} -> {trans_result[i]}")
        '''
        
        process_file(
            "./Input/FSET-847.H265.srt", 
            "./Output/FSET-847.H265.srt"
        )
        print("翻译完成")
        
    except Exception as e:
        print("Error connecting to the database:", e)
        return

if __name__ == "__main__":
    main()

